home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / fileutil.13 / fileutil / fileutils-3.13 / doc / fileutils.info-2 < prev    next >
Encoding:
GNU Info File  |  1996-07-12  |  40.0 KB  |  1,216 lines

  1. This is Info file ./fileutils.info, produced by Makeinfo-1.63 from the
  2. input file fileutils.texi.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * File utilities: (fileutils).  GNU file utilities.
  6. * chgrp: (fileutils)chgrp invocation.           Change file groups.
  7. * chown: (fileutils)chown invocation.           Change file owners/groups.
  8. * chmod: (fileutils)chmod invocation.           Change file permissions.
  9. * cp: (fileutils)cp invocation.                 Copy files.
  10. * dd: (fileutils)dd invocation.                 Copy and convert a file.
  11. * df: (fileutils)df invocation.                 Report filesystem disk usage.
  12. * dir: (fileutils)dir invocation.               List directories briefly.
  13. * dircolors: (fileutils)dircolors invocation.   Color setup for ls.
  14. * du: (fileutils)du invocation.                 Report on disk usage.
  15. * install: (fileutils)install invocation.       Copy and change attributes.
  16. * ln: (fileutils)ln invocation.                 Make links between files.
  17. * ls: (fileutils)ls invocation.                 List directory contents.
  18. * mkdir: (fileutils)mkdir invocation.           Create directories.
  19. * mkfifo: (fileutils)mkfifo invocation.         Create FIFOs: (named pipes).
  20. * mknod: (fileutils)mknod invocation.           Create special files.
  21. * mv: (fileutils)mv invocation.                 Rename files.
  22. * rm: (fileutils)rm invocation.                 Remove files.
  23. * rmdir: (fileutils)rmdir invocation.           Remove empty directories.
  24. * sync: (fileutils)sync invocation.             Synchronize memory and disk.
  25. * touch: (fileutils)touch invocation.           Change file timestamps.
  26. * vdir: (fileutils)vdir invocation.             List directories verbosely.
  27. END-INFO-DIR-ENTRY
  28.  
  29.    This file documents the GNU set of file utilities.
  30.  
  31.    Copyright (C) 1994, 95, 96 Free Software Foundation, Inc.
  32.  
  33.    Permission is granted to make and distribute verbatim copies of this
  34. manual provided the copyright notice and this permission notice are
  35. preserved on all copies.
  36.  
  37.    Permission is granted to copy and distribute modified versions of
  38. this manual under the conditions for verbatim copying, provided that
  39. the entire resulting derived work is distributed under the terms of a
  40. permission notice identical to this one.
  41.  
  42.    Permission is granted to copy and distribute translations of this
  43. manual into another language, under the above conditions for modified
  44. versions, except that this permission notice may be stated in a
  45. translation approved by the Foundation.
  46.  
  47. 
  48. File: fileutils.info,  Node: cp invocation,  Next: dd invocation,  Up: Basic operations
  49.  
  50. `cp': Copy files and directories
  51. ================================
  52.  
  53.    `cp' copies files (or, optionally, directories).  The copy is
  54. completely independent of the original.  You can either copy one file to
  55. another, or copy arbitrarily many files to a destination directory.
  56. Synopsis:
  57.  
  58.      cp [OPTION]... SOURCE DEST
  59.      cp [OPTION]... SOURCE... DIRECTORY
  60.  
  61.    If the last argument names an existing directory, `cp' copies each
  62. SOURCE file into that directory (retaining the same name).  Otherwise,
  63. if only two files are given, it copies the first onto the second.  It
  64. is an error if the last argument is not a directory and more than two
  65. non-option arguments are given.
  66.  
  67.    Generally, files are written just as they are read.  For exceptions,
  68. see the `--sparse' option below.
  69.  
  70.    By default, `cp' does not copy directories (see `-r' below).
  71.  
  72.    `cp' generally refuses to copy a file onto itself, with the
  73. following exception: if `--force --backup' is specified with SOURCE and
  74. DEST identical, and referring to a regular file, `cp' will make a
  75. backup file, either regular or numbered, as specified in the usual ways
  76. (*note Backup options::.).  This is useful when you simply want to make
  77. a backup of an existing file before changing it.
  78.  
  79.    The program accepts the following options.  Also see *Note Common
  80. options::.
  81.  
  82. `-a'
  83. `--archive'
  84.      Preserve as much as possible of the structure and attributes of the
  85.      original files in the copy (but do not preserve directory
  86.      structure).  Equivalent to `-dpR'.
  87.  
  88. `-b'
  89. `--backup'
  90.      Make backups of files that are about to be overwritten or removed.
  91.      *Note Backup options::.
  92.  
  93. `-d'
  94. `--no-dereference'
  95.      Copy symbolic links as symbolic links rather than copying the
  96.      files that they point to, and preserve hard links between source
  97.      files in the copies.
  98.  
  99. `-f'
  100. `--force'
  101.      Remove existing destination files.
  102.  
  103. `-i'
  104. `--interactive'
  105.      Prompt whether to overwrite existing regular destination files.
  106.  
  107. `-l'
  108. `--link'
  109.      Make hard links instead of copies of non-directories.
  110.  
  111. `-p'
  112. `--preserve'
  113.      Preserve the original files' owner, group, permissions, and
  114.      timestamps.
  115.  
  116. `-P'
  117. `--parents'
  118.      Form the name of each destination file by appending to the target
  119.      directory a slash and the specified name of the source file.  The
  120.      last argument given to `cp' must be the name of an existing
  121.      directory.  For example, the command:
  122.  
  123.           cp --parents a/b/c existing_dir
  124.  
  125.      copies the file `a/b/c' to `existing_dir/a/b/c', creating any
  126.      missing intermediate directories.
  127.  
  128. `-r'
  129.      Copy directories recursively, copying any non-directories and
  130.      non-symbolic links (that is, FIFOs and special files) as if they
  131.      were regular files.  This means trying to read the data in each
  132.      source file and writing it to the destination.  Thus, with this
  133.      option, `cp' may well hang indefinitely reading a FIFO, unless
  134.      something else happens to be writing it.
  135.  
  136. `-R'
  137. `--recursive'
  138.      Copy directories recursively, preserving non-directories (see `-r'
  139.      just above).
  140.  
  141. `--sparse=WHEN'
  142.      A "sparse file" contains "holes"--a sequence of zero bytes that
  143.      does not occupy any physical disk blocks; the `read' system call
  144.      reads these as zeroes.  This can both save considerable disk space
  145.      and increase speed, since many binary files contain lots of
  146.      consecutive zero bytes.  By default, `cp' detects holes in input
  147.      source files via a crude heuristic and makes the corresponding
  148.      output file sparse as well.
  149.  
  150.      The WHEN value can be one of the following:
  151.     `auto'
  152.           The default behavior: the output file is sparse if the input
  153.           file is sparse.
  154.  
  155.     `always'
  156.           Always make the output file sparse.  This is useful when the
  157.           input file resides on a filesystem that does not support
  158.           sparse files (the most notable example is `efs' filesystems
  159.           in SGI IRIX 5.3 and earlier), but the output file is on
  160.           another type of filesystem.
  161.  
  162.     `never'
  163.           Never make the output file sparse.  If you find an
  164.           application for this option, let us know.
  165.  
  166. `-s'
  167. `--symbolic-link'
  168.      Make symbolic links instead of copies of non-directories.  All
  169.      source file names must be absolute (starting with `/') unless the
  170.      destination files are in the current directory.  This option merely
  171.      results in an error message on systems that do not support
  172.      symbolic links.
  173.  
  174. `-S SUFFIX'
  175. `--suffix=SUFFIX'
  176.      Append SUFFIX to each backup file made with `-b'.  *Note Backup
  177.      options::.
  178.  
  179. `-u'
  180. `--update'
  181.      Do not copy a nondirectory that has an existing destination with
  182.      the same or newer modification time.
  183.  
  184. `-v'
  185. `--verbose'
  186.      Print the name of each file before copying it.
  187.  
  188. `-V METHOD'
  189. `--version-control=METHOD'
  190.      Change the type of backups made with `-b'.  The METHOD argument
  191.      can be `numbered' (or `t'), `existing' (or `nil'), or `never' (or
  192.      `simple').  *Note Backup options::.
  193.  
  194. `-x'
  195. `--one-file-system'
  196.      Skip subdirectories that are on different filesystems from the one
  197.      that the copy started on.
  198.  
  199. 
  200. File: fileutils.info,  Node: dd invocation,  Next: install invocation,  Prev: cp invocation,  Up: Basic operations
  201.  
  202. `dd': Convert and copy a file
  203. =============================
  204.  
  205.    `dd' copies a file (from standard input to standard output, by
  206. default) with a changeable I/O blocksize, while optionally performing
  207. conversions on it.  Synopsis:
  208.  
  209.      dd [OPTION]...
  210.  
  211.    The program accepts the following options.  Also see *Note Common
  212. options::.
  213.  
  214.    The numeric-valued options below (BYTES and BLOCKS) can be followed
  215. by a multiplier: `b'=512, `c'=1, `k'=1024, `w'=2, `xM'=M.
  216.  
  217. `if=FILE'
  218.      Read from FILE instead of standard input.
  219.  
  220. `of=FILE'
  221.      Write to FILE instead of standard output.  Unless `conv=notrunc'
  222.      is given, `dd' truncates FILE to zero bytes (or the size specified
  223.      with `seek=').
  224.  
  225. `ibs=BYTES'
  226.      Read BYTES bytes at a time.
  227.  
  228. `obs=BYTES'
  229.      Write BYTES bytes at a time.
  230.  
  231. `bs=BYTES'
  232.      Both read and write BYTES bytes at a time.  This overrides `ibs'
  233.      and `obs'.
  234.  
  235. `cbs=BYTES'
  236.      Convert BYTES bytes at a time.
  237.  
  238. `skip=BLOCKS'
  239.      Skip BLOCKS `ibs'-byte blocks in the input file before copying.
  240.  
  241. `seek=BLOCKS'
  242.      Skip BLOCKS `obs'-byte blocks in the output file before copying.
  243.  
  244. `count=BLOCKS'
  245.      Copy BLOCKS `obs'-byte blocks from the input file, instead of
  246.      everything until the end of the file.
  247.  
  248. `conv=CONVERSION[,CONVERSION]...'
  249.      Convert the file as specified by the CONVERSION argument(s).  (No
  250.      spaces around any comma(s).)
  251.  
  252.      Conversions:
  253.  
  254.     `ascii'
  255.           Convert EBCDIC to ASCII.
  256.  
  257.     `ebcdic'
  258.           Convert ASCII to EBCDIC.
  259.  
  260.     `ibm'
  261.           Convert ASCII to alternate EBCDIC.
  262.  
  263.     `block'
  264.           For each line in the input, output `cbs' bytes, replacing the
  265.           input newline with a space and padding with spaces as
  266.           necessary.
  267.  
  268.     `unblock'
  269.           Replace trailing spaces in each `cbs'-sized input block with a
  270.           newline.
  271.  
  272.     `lcase'
  273.           Change uppercase letters to lowercase.
  274.  
  275.     `ucase'
  276.           Change lowercase letters to uppercase.
  277.  
  278.     `swab'
  279.           Swap every pair of input bytes.  GNU `dd', unlike others,
  280.           works when an odd number of bytes are read--the last byte is
  281.           simply copied (since there is nothing to swap it with).
  282.  
  283.     `noerror'
  284.           Continue after read errors.
  285.  
  286.     `notrunc'
  287.           Do not truncate the output file.
  288.  
  289.     `sync'
  290.           Pad every input block to size of `ibs' with trailing zero
  291.           bytes.
  292.  
  293. 
  294. File: fileutils.info,  Node: install invocation,  Next: mv invocation,  Prev: dd invocation,  Up: Basic operations
  295.  
  296. `install': Copy files and set attributes
  297. ========================================
  298.  
  299.    `install' copies files while setting their permission modes and, if
  300. possible, their owner and group.  Synopses:
  301.  
  302.      install [OPTION]... SOURCE DEST
  303.      install [OPTION]... SOURCE... DIRECTORY
  304.      install -d [OPTION]... DIRECTORY...
  305.  
  306.    In the first of these, the SOURCE file is copied to the DEST target
  307. file.  In the second, each of the SOURCE files are copied to the
  308. destination DIRECTORY.  In the last, each DIRECTORY (and any missing
  309. parent directories) is created.
  310.  
  311.    `install' is similar to `cp', but allows you to control the
  312. attributes of destination files.  It is typically used in Makefiles to
  313. copy programs into their destination directories.  It refuses to copy
  314. files onto themselves.
  315.  
  316.    The program accepts the following options.  Also see *Note Common
  317. options::.
  318.  
  319. `-b'
  320. `--backup'
  321.      Make backups of files that are about to be overwritten or removed.
  322.      *Note Backup options::.
  323.  
  324. `-c'
  325.      Ignored; for compatibility with old Unix versions of `install'.
  326.  
  327. `-d'
  328. `--directory'
  329.      Create each given directory and any missing parent directories,
  330.      setting the owner, group and mode as given on the command line or
  331.      to the defaults.  It also gives any parent directories it creates
  332.      those attributes.  (This is different from the SunOS 4.x
  333.      `install', which gives directories that it creates the default
  334.      attributes.)
  335.  
  336. `-g GROUP'
  337. `--group=GROUP'
  338.      Set the group ownership of installed files or directories to
  339.      GROUP. The default is the process's current group.  GROUP may be
  340.      either a group name or a numeric group id.
  341.  
  342. `-m MODE'
  343. `--mode=MODE'
  344.      Set the permissions for the installed file or directory to MODE,
  345.      which can be either an octal number, or a symbolic mode as in
  346.      `chmod', with 0 as the point of departure (*note File
  347.      permissions::.).  The default mode is 0755--read, write, and
  348.      execute for the owner, and read and execute for group and other.
  349.  
  350. `-o OWNER'
  351. `--owner=OWNER'
  352.      If `install' has appropriate privileges (is run as root), set the
  353.      ownership of installed files or directories to OWNER. The default
  354.      is `root'.  OWNER may be either a user name or a numeric user ID.
  355.  
  356. `-s'
  357. `--strip'
  358.      Strip the symbol tables from installed binary executables.
  359.  
  360. `-S SUFFIX'
  361. `--suffix=SUFFIX'
  362.      Append SUFFIX to each backup file made with `-b'.  *Note Backup
  363.      options::.
  364.  
  365. `-V METHOD'
  366. `--version-control=METHOD'
  367.      Change the type of backups made with `-b'.  The METHOD argument
  368.      can be `numbered' (or `t'), `existing' (or `nil'), or `never' (or
  369.      `simple').  *Note Backup options::.
  370.  
  371. 
  372. File: fileutils.info,  Node: mv invocation,  Next: rm invocation,  Prev: install invocation,  Up: Basic operations
  373.  
  374. `mv': Move (rename) files
  375. =========================
  376.  
  377.    `mv' moves or renames files (or directories).  Synopsis:
  378.  
  379.      mv [OPTION]... SOURCE DEST
  380.      mv [OPTION]... SOURCE... DIRECTORY
  381.  
  382.    If the last argument names an existing directory, `mv' moves each
  383. other given file into a file with the same name in that directory.
  384. Otherwise, if only two files are given, it renames the first as the
  385. second.  It is an error if the last argument is not a directory and
  386. more than two files are given.
  387.  
  388.    `mv' can move only regular files across filesystems.
  389.  
  390.    If a destination file exists but is normally unwritable, standard
  391. input is a terminal, and the `-f' or `--force' option is not given,
  392. `mv' prompts the user for whether to replace the file.  (You might own
  393. the file, or have write permission on its directory.)  If the response
  394. does not begin with `y' or `Y', the file is skipped.
  395.  
  396.    The program accepts the following options.  Also see *Note Common
  397. options::.
  398.  
  399. `-b'
  400. `--backup'
  401.      Make backups of files that are about to be overwritten or removed.
  402.      *Note Backup options::.
  403.  
  404. `-f'
  405. `--force'
  406.      Remove existing destination files and never prompt the user.
  407.  
  408. `-i'
  409. `--interactive'
  410.      Prompt whether to overwrite each existing destination file,
  411.      regardless of its permissions.  If the response does not begin
  412.      with `y' or `Y', the file is skipped.
  413.  
  414. `-u'
  415. `--update'
  416.      Do not move a nondirectory that has an existing destination with
  417.      the same or newer modification time.
  418.  
  419. `-v'
  420. `--verbose'
  421.      Print the name of each file before moving it.
  422.  
  423. `-S SUFFIX'
  424. `--suffix=SUFFIX'
  425.      Append SUFFIX to each backup file made with `-b'.  *Note Backup
  426.      options::.
  427.  
  428. `-V METHOD'
  429. `--version-control=METHOD'
  430.      Change the type of backups made with `-b'.  The METHOD argument
  431.      can be `numbered' (or `t'), `existing' (or `nil'), or `never' (or
  432.      `simple').  *Note Backup options::.
  433.  
  434. 
  435. File: fileutils.info,  Node: rm invocation,  Prev: mv invocation,  Up: Basic operations
  436.  
  437. `rm': Remove files or directories
  438. =================================
  439.  
  440.    `rm' removes each given FILE.  By default, it does not remove
  441. directories.  Synopsis:
  442.  
  443.      rm [OPTION]... [FILE]...
  444.  
  445.    If a file is unwritable, standard input is a terminal, and the `-f'
  446. or `--force' option is not given, or the `-i' or `--interactive' option
  447. *is* given, `rm' prompts the user for whether to remove the file.  If
  448. the response does not begin with `y' or `Y', the file is skipped.
  449.  
  450.    The program accepts the following options.  Also see *Note Common
  451. options::.
  452.  
  453. `-d'
  454. `--directory'
  455.      Remove directories with `unlink' instead of `rmdir', and don't
  456.      require a directory to be empty before trying to unlink it.  Only
  457.      works if you have appropriate privileges.  Because unlinking a
  458.      directory causes any files in the deleted directory to become
  459.      unreferenced, it is wise to `fsck' the filesystem after doing this.
  460.  
  461. `-f'
  462. `--force'
  463.      Ignore nonexistent files and never prompt the user.
  464.  
  465. `-i'
  466. `--interactive'
  467.      Prompt whether to remove each file.  If the response does not begin
  468.      with `y' or `Y', the file is skipped.
  469.  
  470. `-r'
  471. `-R'
  472. `--recursive'
  473.      Remove the contents of directories recursively.
  474.  
  475. `-v'
  476. `--verbose'
  477.      Print the name of each file before removing it.
  478.  
  479.    One common question is how to remove files whose names being with a
  480. `-'.  GNU `rm', like every program that uses the `getopt' function to
  481. parse its arguments, lets you use the `--' option to indicate that all
  482. following arguments are non-options.  To remove a file called `-f' in
  483. the current directory, you could type either:
  484.  
  485.      rm -- -f
  486.  
  487. or:
  488.  
  489.      rm ./-f
  490.  
  491.    The Unix `rm' program's use of a single `-' for this purpose
  492. predates the development of the getopt standard syntax.
  493.  
  494. 
  495. File: fileutils.info,  Node: Special file types,  Next: Changing file attributes,  Prev: Basic operations,  Up: Top
  496.  
  497. Special file types
  498. ******************
  499.  
  500.    This chapter describes commands which create special types of files
  501. (and `rmdir', which removes directories, one special file type).
  502.  
  503.    Although Unix-like operating systems have markedly fewer special file
  504. types than others, not *everything* can be treated only as the
  505. undifferentiated byte stream of "normal files".  For example, when a
  506. file is created or removed, the system must record this information,
  507. which it does in a "directory"--a special type of file.  Although you
  508. can read directories as normal files, if you're curious, in order for
  509. the system to do its job it must impose a structure, a certain order,
  510. on the bytes of the file.  Thus it is a "special" type of file.
  511.  
  512.    Besides directories, other special file types include named pipes
  513. (FIFOs), symbolic links, sockets, and so-called "special files".
  514.  
  515. * Menu:
  516.  
  517. * ln invocation::               Make links between files.
  518. * mkdir invocation::            Make directories.
  519. * mkfifo invocation::           Make FIFOs (named pipes).
  520. * mknod invocation::            Make block or character special files.
  521. * rmdir invocation::            Remove empty directories.
  522.  
  523. 
  524. File: fileutils.info,  Node: ln invocation,  Next: mkdir invocation,  Up: Special file types
  525.  
  526. `ln': Make links between files
  527. ==============================
  528.  
  529.    `ln' makes links between files.  By default, it makes hard links;
  530. with the `-s' option, it makes symbolic (or "soft") links.  Synopses:
  531.  
  532.      ln [OPTION]... SOURCE [DEST]
  533.      ln [OPTION]... SOURCE... DIRECTORY
  534.  
  535.    If the last argument names an existing directory, `ln' links each
  536. SOURCE file into a file with the same name in that directory.  (But see
  537. the description of the `--no-dereference' option below.) If only one
  538. file is given, it links that file into the current directory.
  539. Otherwise, if only two files are given, it links the first onto the
  540. second.  It is an error if the last argument is not a directory and more
  541. than two files are given.  By default, it does not remove existing
  542. files.
  543.  
  544.    A "hard link" is another name for an existing file; the link and the
  545. original are indistinguishable.  (Technically speaking, they share the
  546. same inode, and the inode contains all the information about a
  547. file--indeed, it is not incorrect to say that the inode *is* the file.)
  548. On all existing implementations, you cannot make a hard links to
  549. directories, and hard links cannot cross filesystem boundaries.  (These
  550. restrictions are not mandated by POSIX, however.)
  551.  
  552.    "Symbolic links" ("symlinks" for short), on the other hand, are a
  553. special file type (which not all kernels support; in particular, system
  554. V release 3 (and older) systems lack symlinks) in which the link file
  555. actually refers to a different file, by name.  When most operations
  556. (opening, reading, writing, and so on) are passed the symbolic link
  557. file, the kernel automatically "dereferences" the link and operates on
  558. the target of the link.  But some operations (e.g., removing) work on
  559. the link file itself, rather than on its target.  *Note Symbolic Links:
  560. (library)Symbolic Links.
  561.  
  562.    The program accepts the following options.  Also see *Note Common
  563. options::.
  564.  
  565. `-b'
  566. `--backup'
  567.      Make backups of files that are about to be overwritten or removed.
  568.      *Note Backup options::.
  569.  
  570. `-d'
  571. `-F'
  572. `--directory'
  573.      Allow the super-user to make hard links to directories.
  574.  
  575. `-f'
  576. `--force'
  577.      Remove existing destination files.
  578.  
  579. `-i'
  580. `--interactive'
  581.      Prompt whether to remove existing destination files.
  582.  
  583. `-n'
  584. `--no-dereference'
  585.      When given an explicit destination that is a symlink to a
  586.      directory, treat that destination as if it were a normal file.
  587.  
  588.      When the destination is an actual directory (not a symlink to one),
  589.      there is no ambiguity.  The link is created in that directory.
  590.      But when the specified destination is a symlink to a directory,
  591.      there are two ways to treat the user's request.  `ln' can treat
  592.      the destination just as it would a normal directory and create the
  593.      link in it.  On the other hand, the destination can be viewed as a
  594.      non-directory--as the symlink itself.  In that case, `ln' must
  595.      delete or backup that symlink before creating the new link.  The
  596.      default is to treat a destination that is a symlink to a directory
  597.      just like a directory.
  598.  
  599. `-s'
  600. `--symbolic'
  601.      Make symbolic links instead of hard links.  This option merely
  602.      produces an error message on systems that do not support symbolic
  603.      links.
  604.  
  605. `-v'
  606. `--verbose'
  607.      Print the name of each file before linking it.
  608.  
  609. `-S SUFFIX'
  610. `--suffix=SUFFIX'
  611.      Append SUFFIX to each backup file made with `-b'.  *Note Backup
  612.      options::.
  613.  
  614. `-V METHOD'
  615. `--version-control=METHOD'
  616.      Change the type of backups made with `-b'.  The METHOD argument
  617.      can be `numbered' (or `t'), `existing' (or `nil'), or `never' (or
  618.      `simple').  *Note Backup options::.
  619.  
  620. 
  621. File: fileutils.info,  Node: mkdir invocation,  Next: mkfifo invocation,  Prev: ln invocation,  Up: Special file types
  622.  
  623. `mkdir': Make directories
  624. =========================
  625.  
  626.    `mkdir' creates directories with the specified names.  Synopsis:
  627.  
  628.      mkdir [OPTION]... NAME...
  629.  
  630.    It is not an error if a NAME is already a directory; `mkdir' simply
  631. proceeds.  But if a NAME is an existing file and is anything but a
  632. directory, `mkdir' complains.
  633.  
  634.    The program accepts the following options.  Also see *Note Common
  635. options::.
  636.  
  637. `-m MODE'
  638. `--mode=MODE'
  639.      Set the mode of created directories to MODE, which is symbolic as
  640.      in `chmod' and uses 0777 (read, write and execute allowed for
  641.      everyone) minus the bits set in the umask for the point of the
  642.      departure.  *Note File permissions::.
  643.  
  644. `-p'
  645. `--parents'
  646.      Make any missing parent directories for each argument.  The mode
  647.      for parent directories is set to the umask modified by `u+wx'.
  648.      Ignore arguments corresponding to existing directories.
  649.  
  650. `--verbose'
  651.      Print a message for each created directory.  This is most useful
  652.      with `--parents'.
  653.  
  654. 
  655. File: fileutils.info,  Node: mkfifo invocation,  Next: mknod invocation,  Prev: mkdir invocation,  Up: Special file types
  656.  
  657. `mkfifo': Make FIFOs (named pipes)
  658. ==================================
  659.  
  660.    `mkfifo' creates FIFOs (also called "named pipes") with the
  661. specified names.  Synopsis:
  662.  
  663.      mkfifo [OPTION] NAME...
  664.  
  665.    A "FIFO" is a special file type that permits independent processes
  666. to communicate.  One process opens the FIFO file for writing, and
  667. another for reading, after which data can flow as with the usual
  668. anonymous pipe in shells or elsewhere.
  669.  
  670.    The program accepts the following option.  Also see *Note Common
  671. options::.
  672.  
  673. `-m MODE'
  674. `--mode=MODE'
  675.      Set the mode of created FIFOs to MODE, which is symbolic as in
  676.      `chmod' and uses 0666 (read and write allowed for everyone) minus
  677.      the bits set in the umask for the point of departure.  *Note File
  678.      permissions::.
  679.  
  680. 
  681. File: fileutils.info,  Node: mknod invocation,  Next: rmdir invocation,  Prev: mkfifo invocation,  Up: Special file types
  682.  
  683. `mknod': Make block or character special files
  684. ==============================================
  685.  
  686.    `mknod' creates a FIFO, character special file, or block special
  687. file with the specified name.  Synopsis:
  688.  
  689.      mknod [OPTION]... NAME TYPE [MAJOR MINOR]
  690.  
  691.    Unlike the phrase "special file type" above, the term "special file"
  692. has a technical meaning on Unix: something that can generate or receive
  693. data.  Usually this corresponds to a physical piece of hardware, e.g.,
  694. a printer or a disk.  (These files are typically created at
  695. system-configuration time.)  The `mknod' command is what creates files
  696. of this type.  Such devices can be read either a character at a time or
  697. a "block" (many characters) at a time, hence we say there are "block
  698. special" files and "character special" files.
  699.  
  700.    The arguments after NAME specify the type of file to make:
  701.  
  702. `p'
  703.      for a FIFO
  704.  
  705. `b'
  706.      for a block (buffered) special file
  707.  
  708. `c'
  709.      for a character (buffered) special file
  710.  
  711. `u'
  712.      for a character (unbuffered) special file
  713.  
  714.    When making a block or character special file, the major and minor
  715. device numbers must be given after the file type.
  716.  
  717.    The program accepts the following option.  Also see *Note Common
  718. options::.
  719.  
  720. `-m MODE'
  721. `--mode=MODE'
  722.      Set the mode of created files to MODE, which is symbolic as in
  723.      `chmod' and uses 0666 minus the bits set in the umask as the point
  724.      of departure.  *Note File permissions::.
  725.  
  726. 
  727. File: fileutils.info,  Node: rmdir invocation,  Prev: mknod invocation,  Up: Special file types
  728.  
  729. `rmdir': Remove empty directories
  730. =================================
  731.  
  732.    `rmdir' removes empty directories.  Synopsis:
  733.  
  734.      rmdir [OPTION]... DIRECTORY...
  735.  
  736.    If any DIRECTORY argument does not refer to an existing empty
  737. directory, it is an error.
  738.  
  739.    The program accepts the following option.  Also see *Note Common
  740. options::.
  741.  
  742. `-p'
  743. `--parents'
  744.      Remove any parent directories that become empty after an argument
  745.      DIRECTORY is removed.
  746.  
  747.    *Note rm invocation::, for how to remove non-empty directories
  748. (recursively).
  749.  
  750. 
  751. File: fileutils.info,  Node: Changing file attributes,  Next: Disk usage,  Prev: Special file types,  Up: Top
  752.  
  753. Changing file attributes
  754. ************************
  755.  
  756.    A file is not merely its contents, a name, and a file type (*note
  757. Special file types::.).  A file also has an owner (a userid), a group
  758. (a group id), permissions (what the owner can do with the file, what
  759. people in the group can do, and what everyone else can do), various
  760. timestamps, and other information.  Collectively, we call these a file's
  761. "attributes".
  762.  
  763.    These commands change file attributes.
  764.  
  765. * Menu:
  766.  
  767. * chown invocation::            Change file owners and groups.
  768. * chgrp invocation::            Change file groups.
  769. * chmod invocation::            Change access permissions.
  770. * touch invocation::            Change file timestamps.
  771.  
  772. 
  773. File: fileutils.info,  Node: chown invocation,  Next: chgrp invocation,  Up: Changing file attributes
  774.  
  775. `chown': Change file owner and group
  776. ====================================
  777.  
  778.    `chown' changes the user and/or group ownership of each given file.
  779. Synopsis:
  780.  
  781.      chown [OPTION]... NEW-OWNER FILE...
  782.  
  783.    The first non-option argument, NEW-OWNER, specifies the new owner
  784. and/or group, as follows (with no embedded white space):
  785.  
  786.      [OWNER] [ [:.] [GROUP] ]
  787.  
  788.    Specifically:
  789.  
  790. OWNER
  791.      If only an OWNER (a user name or numeric user id) is given, that
  792.      user is made the owner of each given file, and the files' group is
  793.      not changed.
  794.  
  795. OWNER`.'GROUP
  796. OWNER`:'GROUP
  797.      If the OWNER is followed by a colon or dot and a GROUP (a group
  798.      name or numeric group id), with no spaces between them, the group
  799.      ownership of the files is changed as well (to GROUP).
  800.  
  801. OWNER`.'
  802. OWNER`:'
  803.      If a colon or dot but no group name follows OWNER, that user is
  804.      made the owner of the files and the group of the files is changed
  805.      to OWNER's login group.
  806.  
  807. `.'GROUP
  808. `:'GROUP
  809.      If the colon or dot and following GROUP are given, but the owner
  810.      is omitted, only the group of the files is changed; in this case,
  811.      `chown' performs the same function as `chgrp'.
  812.  
  813.    The program accepts the following options.  Also see *Note Common
  814. options::.
  815.  
  816. `-c'
  817. `--changes'
  818.      Verbosely describe the action for each FILE whose ownership
  819.      actually changes.
  820.  
  821. `-f'
  822. `--silent'
  823. `--quiet'
  824.      Do not print error messages about files whose ownership cannot be
  825.      changed.
  826.  
  827. `-f'
  828. `--no-dereference'
  829.      Act on symbolic links themselves instead of what they point to.
  830.      Only available if the `lchown' system call is provided.
  831.  
  832. `-v'
  833. `--verbose'
  834.      Verbosely describe the action (or non-action) taken for every FILE.
  835.  
  836. `-R'
  837. `--recursive'
  838.      Recursively change ownership of directories and their contents.
  839.  
  840. 
  841. File: fileutils.info,  Node: chgrp invocation,  Next: chmod invocation,  Prev: chown invocation,  Up: Changing file attributes
  842.  
  843. `chgrp': Change group ownership
  844. ===============================
  845.  
  846.    `chgrp' changes the group ownership of each given FILE to GROUP,
  847. which can be either a group name or a numeric group id.  Synopsis:
  848.  
  849.      chgrp [OPTION]... GROUP FILE...
  850.  
  851.    The program accepts the following options.  Also see *Note Common
  852. options::.
  853.  
  854. `-c'
  855. `--changes'
  856.      Verbosely describe the action for each FILE whose group actually
  857.      changes.
  858.  
  859. `-f'
  860. `--silent'
  861. `--quiet'
  862.      Do not print error messages about files whose group cannot be
  863.      changed.
  864.  
  865. `-f'
  866. `--no-dereference'
  867.      Act on symbolic links themselves instead of what they point to.
  868.      Only available if the `lchown' system call is provided.
  869.  
  870. `-v'
  871. `--verbose'
  872.      Verbosely describe the action or non-action taken for every FILE.
  873.  
  874. `-R'
  875. `--recursive'
  876.      Recursively change the group ownership of directories and their
  877.      contents.
  878.  
  879. 
  880. File: fileutils.info,  Node: chmod invocation,  Next: touch invocation,  Prev: chgrp invocation,  Up: Changing file attributes
  881.  
  882. `chmod': Change access permissions
  883. ==================================
  884.  
  885.    `chmod' changes the access permissions of the named files.  Synopsis:
  886.  
  887.      chmod [OPTION]... MODE FILE...
  888.  
  889.    `chmod' never changes the permissions of symbolic links, since the
  890. `chmod' system call cannot change their permissions.  This is not a
  891. problem since the permissions of symbolic links are never used.
  892. However, for each symbolic link listed on the command line, `chmod'
  893. changes the permissions of the pointed-to file.  In contrast, `chmod'
  894. ignores symbolic links encountered during recursive directory
  895. traversals.
  896.  
  897.    The first non-option argument, MODE, specifies the new permissions.
  898. See the section below for details.
  899.  
  900.    The program accepts the following options.  Also see *Note Common
  901. options::.
  902.  
  903. `-c'
  904. `--changes'
  905.      Verbosely describe the action for each FILE whose permissions
  906.      actually changes.
  907.  
  908. `-f'
  909. `--silent'
  910. `--quiet'
  911.      Do not print error messages about files whose permissions cannot be
  912.      changed.
  913.  
  914. `-v'
  915. `--verbose'
  916.      Verbosely describe the action or non-action taken for every FILE.
  917.  
  918. `-R'
  919. `--recursive'
  920.      Recursively change permissions of directories and their contents.
  921.  
  922. 
  923. File: fileutils.info,  Node: touch invocation,  Prev: chmod invocation,  Up: Changing file attributes
  924.  
  925. `touch': Change file timestamps
  926. ===============================
  927.  
  928.    `touch' changes the access and/or modification times of the
  929. specified files.  Synopsis:
  930.  
  931.      touch [OPTION]... FILE...
  932.  
  933.    If the first FILE would be a valid argument to the `-t' option and
  934. no timestamp is given with any of the `-d', `-r', or `-t' options and
  935. the `--' argument is not given, that argument is interpreted as the
  936. time for the other files instead of as a file name.
  937.  
  938.    Any FILE that does not exist is created empty.
  939.  
  940.    If changing both the access and modification times to the current
  941. time, `touch' can change the timestamps for files that the user running
  942. it does not own but has write permission for.  Otherwise, the user must
  943. own the files.
  944.  
  945.    The program accepts the following options.  Also see *Note Common
  946. options::.
  947.  
  948. `-a'
  949. `--time=atime'
  950. `--time=access'
  951. `--time=use'
  952.      Change the access time only.
  953.  
  954. `-c'
  955. `--no-create'
  956.      Do not create files that do not exist.
  957.  
  958. `-d'
  959. `--date=time'
  960.      Use TIME instead of the current time.  It can contain month names,
  961.      timezones, `am' and `pm', etc.  *Note Date input formats::.
  962.  
  963. `-f'
  964.      Ignored; for compatibility with BSD versions of `touch'.
  965.  
  966. `-m'
  967. `--time=mtime'
  968. `--time=modify'
  969.      Change the modification time only.
  970.  
  971. `-r FILE'
  972. `--reference=FILE'
  973.      Use the times of the reference FILE instead of the current time.
  974.  
  975. `-t MMDDhhmm[[CC]YY][.ss]'
  976.      Use the argument (months, days, hours, minutes, optional century
  977.      and years, optional seconds) instead of the current time.
  978.  
  979. 
  980. File: fileutils.info,  Node: Disk usage,  Next: Index,  Prev: Changing file attributes,  Up: Top
  981.  
  982. Disk usage
  983. **********
  984.  
  985.    No disk can hold an infinite amount of data.  These commands report
  986. on how much disk storage is in use or available.  (This has nothing
  987. much to do with how much *main memory*, i.e., RAM, a program is using
  988. when it runs; for that, you want `ps' or `pstat' or `swap' or some such
  989. command.)
  990.  
  991. * Menu:
  992.  
  993. * df invocation::               Report filesystem disk space usage.
  994. * du invocation::               Estimate file space usage.
  995. * sync invocation::             Synchronize memory and disk.
  996.  
  997. 
  998. File: fileutils.info,  Node: df invocation,  Next: du invocation,  Up: Disk usage
  999.  
  1000. `df': Report filesystem disk space usage
  1001. ========================================
  1002.  
  1003.    `df' reports the amount of disk space used and available on
  1004. filesystems.  Synopsis:
  1005.  
  1006.      df [OPTION]... [FILE]...
  1007.  
  1008.    With no arguments, `df' reports the space used and available on all
  1009. currently mounted filesystems (of all types).  Otherwise, `df' reports
  1010. on the filesystem containing each argument FILE.
  1011.  
  1012.    Disk space is shown in 1024-byte blocks by default, unless the
  1013. environment variable `POSIXLY_CORRECT' is set, in which case 512-byte
  1014. blocks are used (unless the `-k' option is given).
  1015.  
  1016.    If an argument FILE is a disk device file containing a mounted
  1017. filesystem, `df' shows the space available on that filesystem rather
  1018. than on the filesystem containing the device node (i.e., the root
  1019. filesystem).  GNU `df' does not attempt to determine the disk usage on
  1020. unmounted filesystems, because on most kinds of systems doing so
  1021. requires extremely nonportable intimate knowledge of filesystem
  1022. structures.
  1023.  
  1024.    The program accepts the following options.  Also see *Note Common
  1025. options::.
  1026.  
  1027. `-a'
  1028. `--all'
  1029.      Include in the listing filesystems that have a size of 0 blocks,
  1030.      which are omitted by default.  Such filesystems are typically
  1031.      special-purpose pseudo-filesystems, such as automounter entries.
  1032.      Also, filesystems of type "ignore" or "auto", supported by some
  1033.      operating systems, are only included if this option is specified.
  1034.  
  1035. `-h'
  1036. `--human-readable'
  1037.      Append a size letter such as `M' for megabytes to each size.
  1038.  
  1039. `-i'
  1040. `--inodes'
  1041.      List inode usage information instead of block usage.  An inode
  1042.      (short for index node) is contains information about a file such
  1043.      as its owner, permissions, timestamps, and location on the disk.
  1044.  
  1045. `-k'
  1046. `--kilobytes'
  1047.      Print sizes in 1024-byte blocks.  This overrides the environment
  1048.      variable `POSIXLY_CORRECT'.
  1049.  
  1050. `-m'
  1051. `--megabytes'
  1052.      Print sizes in megabyte (that 1,048,576 bytes) blocks.
  1053.  
  1054. `--no-sync'
  1055.      Do not invoke the `sync' system call before getting any usage data.
  1056.      This may make `df' run significantly faster on systems with many
  1057.      disks, but on some systems (notably SunOS) the results may be
  1058.      slightly out of date.  This is the default.
  1059.  
  1060. `-P'
  1061. `--portability'
  1062.      Use the POSIX output format.  This is like the default format
  1063.      except that the information about each filesystem is always
  1064.      printed on exactly one line; a mount device is never put on a line
  1065.      by itself.  This means that if the mount device name is more than
  1066.      20 characters long (e.g., for some network mounts), the columns
  1067.      are misaligned.
  1068.  
  1069. `--sync'
  1070.      Invoke the `sync' system call before getting any usage data.  On
  1071.      some systems (notably SunOS), doing this yields more up to date
  1072.      results, but in general this option makes `df' much slower,
  1073.      especially when there are many or very busy filesystems.
  1074.  
  1075. `-t FSTYPE'
  1076. `--type=FSTYPE'
  1077.      Limit the listing to filesystems of type FSTYPE.  Multiple
  1078.      filesystem types can be specified by giving multiple `-t' options.
  1079.      By default, nothing is omitted.
  1080.  
  1081. `-T'
  1082. `--print-type'
  1083.      Print each filesystem's type.  The types printed here are the same
  1084.      ones you can include or exclude with `-t' and `-x'.  The particular
  1085.      types printed are whatever is supported by the system.  Here are
  1086.      some of the common names (this list is certainly not exhaustive):
  1087.  
  1088.     `nfs'
  1089.           An NFS filesystem, i.e., one mounted over a network from
  1090.           another machine.  This is the one type name which seems to be
  1091.           used uniformly by all systems.
  1092.  
  1093.     `4.2, ufs, efs...'
  1094.           A filesystem on a locally-mounted hard disk.  (The system
  1095.           might even support more than one type here; Linux does.)
  1096.  
  1097.     `hsfs, cdfs'
  1098.           A filesystem on a CD-ROM drive.  HP-UX uses `cdfs', most other
  1099.           systems use `hsfs' (`hs' for `High Sierra').
  1100.  
  1101.     `pcfs'
  1102.           An MS-DOS filesystem, usually on a diskette.
  1103.  
  1104. `-x FSTYPE'
  1105. `--exclude-type=FSTYPE'
  1106.      Limit the listing to filesystems not of type FSTYPE.  Multiple
  1107.      filesystem types can be eliminated by giving multiple `-x'
  1108.      options.  By default, no filesystem types are omitted.
  1109.  
  1110. `-v'
  1111.      Ignored; for compatibility with System V versions of `df'.
  1112.  
  1113. 
  1114. File: fileutils.info,  Node: du invocation,  Next: sync invocation,  Prev: df invocation,  Up: Disk usage
  1115.  
  1116. `du': Estimate file space usage
  1117. ===============================
  1118.  
  1119.    `du' reports the amount of disk space used by the specified files
  1120. and for each subdirectory (of directory arguments).  Synopsis:
  1121.  
  1122.      du [OPTION]... [FILE]...
  1123.  
  1124.    With no arguments, `du' reports the disk space for the current
  1125. directory.  The output is in 1024-byte units by default, unless the
  1126. environment variable `POSIXLY_CORRECT' is set, in which case 512-byte
  1127. blocks are used (unless `-k' is specified).
  1128.  
  1129.    The program accepts the following options.  Also see *Note Common
  1130. options::.
  1131.  
  1132. `-a'
  1133. `--all'
  1134.      Show counts for all files, not just directories.
  1135.  
  1136. `-b'
  1137. `--bytes'
  1138.      Print sizes in bytes, instead of kilobytes.
  1139.  
  1140. `-c'
  1141. `--total'
  1142.      Print a grand total of all arguments after all arguments have been
  1143.      processed.  This can be used to find out the total disk usage of a
  1144.      given set of files or directories.
  1145.  
  1146. `-D'
  1147. `--dereference-args'
  1148.      Dereference symbolic links that are command line arguments.  Does
  1149.      not affect other symbolic links.  This is helpful for finding out
  1150.      the disk usage of directories, such as `/usr/tmp', which are often
  1151.      symbolic links.
  1152.  
  1153. `-h'
  1154. `--human-readable'
  1155.      Append a size letter, such as `M' for megabytes, to each size.
  1156.  
  1157. `-k'
  1158. `--kilobytes'
  1159.      Print sizes in kilobytes.  This overrides the environment variable
  1160.      `POSIXLY_CORRECT'.
  1161.  
  1162. `-l'
  1163. `--count-links'
  1164.      Count the size of all files, even if they have appeared already
  1165.      (as a hard link).
  1166.  
  1167. `-L'
  1168. `--dereference'
  1169.      Dereference symbolic links (show the disk space used by the file
  1170.      or directory that the link points to instead of the space used by
  1171.      the link).
  1172.  
  1173. `-m'
  1174. `--megabytes'
  1175.      Print sizes in megabyte (that 1,048,576 bytes) blocks.
  1176.  
  1177. `-s'
  1178. `--summarize'
  1179.      Display only a total for each argument.
  1180.  
  1181. `-S'
  1182. `--separate-dirs'
  1183.      Report the size of each directory separately, not including the
  1184.      sizes of subdirectories.
  1185.  
  1186. `-x'
  1187. `--one-file-system'
  1188.      Skip directories that are on different filesystems from the one
  1189.      that the argument being processed is on.
  1190.  
  1191.    On BSD systems, `du' reports sizes that are half the correct values
  1192. for files that are NFS-mounted from HP-UX systems.  On HP-UX systems,
  1193. it reports sizes that are twice the correct values for files that are
  1194. NFS-mounted from BSD systems.  This is due to a flaw in HP-UX; it also
  1195. affects the HP-UX `du' program.
  1196.  
  1197. 
  1198. File: fileutils.info,  Node: sync invocation,  Prev: du invocation,  Up: Disk usage
  1199.  
  1200. `sync': Synchronize data on disk with memory
  1201. ============================================
  1202.  
  1203.    `sync' writes any data buffered in memory out to disk.  This can
  1204. include (but is not limited to) modified superblocks, modified inodes,
  1205. and delayed reads and writes.  This must be implemented by the kernel;
  1206. The `sync' program does nothing but exercise the `sync' system call.
  1207.  
  1208.    The kernel keeps data in memory to avoid doing (relatively slow) disk
  1209. reads and writes.  This improves performance, but if the computer
  1210. crashes, data may be lost or the filesystem corrupted as a result.
  1211. `sync' ensures everything in memory is written to disk.
  1212.  
  1213.    Any arguments are ignored, except for a lone `--help' or `--version'
  1214. (*note Common options::.).
  1215.  
  1216.